using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;

public class MinusManager : MonoBehaviour
{
    public TextMesh minusNumText;
    public int minusNum;
    public GameObject text;

    void Start()
    {
        minusNum = int.Parse(minusNumText.text);
    }

    private void OnTriggerEnter(Collider other)
    {
        Tweener tweener = text.transform.DOPunchScale(new Vector3(0, 1, 0), 0.5f, 1, 0);
        Destroy(other.gameObject);
        minusNum++;
        minusNumText.text = minusNum.ToString();
        if (minusNum == 0)
        {
            Destroy(this.gameObject);
        }
    }
}
